<?php
//use Admin\Lib\Com\Data;
//$position = Data::position();
//$alpha = Data::alpha();
?>
{layout name="layout/layout" /}
<div class="king-content-wrap">
    <div class="king-layout1-content" style="margin-top: 0px;margin-left: 107;">
		<ol class="breadcrumb">
            <li><span>系统设置</span></li>
        </ol>
		<div class=" m20">
			<ul class="nav nav-tabs" role="tablist" id="myTab">
				<li role="presentation" class="active"><a href="#home" role="tab" data-toggle="tab">站点信息配置</a></li>
				<li role="presentation"><a href="#profile" role="tab" data-toggle="tab">上传文件配置</a></li>
				<!--li role="presentation"><a href="#messages" role="tab" data-toggle="tab">图片水印配置</a></li-->
			</ul>
			<div class="tab-content">
				<div role="tabpanel" class="tab-pane" id="profile">
					<form action="{:Url('System/index')}" method="post" class="p20">
						<div class="form-group">
							<label class="label_name">上传图片类型</label>
							<input  class="form-control" type="text" name="item[img_type]" value="{$item['img_type']?$item['img_type']:''}" />
							<span><strong class="bos_red">*</strong>配置网站能上传的所有图片类型,eg:jpg,png</span>
						</div>
						<div class="form-group">
							<label  class="label_name">上传文件类型</label>
							<input  class="form-control" type="text" name="item[file_type]" value="{$item['file_type']?$item['file_type']:''}" />
							<span><strong class="bos_red">*</strong>配置网站能上传的所有文件类型,eg:swf,flv</span>
						</div>
						<div class="form-group">
							<label  class="label_name">上传图片大小</label>
							<input name="img_size" class="form-control" type="text" value="{:number_format($item['img_size']?$item['img_size']/(1024*1024).'MB':'',2)}" />
							<span><strong class="bos_red">*</strong>(单位:MB）网站上传图片大小控制,建议最佳500Kb以内</span>
						</div>

						<div class="form-group">
							<label class="label_name">上传文件大小</label>
							<input class="form-control" type="text" name="file_size" value="{:number_format($item['file_size']?$item['file_size']/(1024*1024).'MB':'',2)}" />
							<span><strong class="bos_red">*</strong>(单位:MB）网站上传文件大小控制,建议最佳100M以内</span>
						</div>

						<div class="form-group">
							<input type="submit" class="btn btn-primary" value="确认" />
						</div>
					</form>
				</div>
				<div role="tabpanel" class="tab-pane" id="messages">
					<form action="{:U('System/index')}" method="post" id="form" class="p20">
						<div class="form-group">
							<label class="label_name">水印位置</label>
							<select class="form-control" name="item[mark_position]">
								<volist name="position" id="pos" key="k">
									<option {$k==$item['mark_position']?"selected":''} value="{$k}">{$pos}</option>
								</volist>
							</select>
						</div>
						<div class="form-group ">
							<label class="label_name">水印透明度</label>
							<input class="form-control" type="text" name="item[mark_alpha]" value="{$item['mark_alpha']?$item['mark_alpha']:''}" />
							<span><strong class="bos_red"></strong>0~100，默认值是80</span>
						</div>
						<div class="form-group">
							<label class="label_name">水印类型</label>
							<div class="label_checked radio">
								<label>
								    <input type="radio" name="item[mark_type]" id="image" {$item['mark_type']==1?checked:''} value="1" >图片
								 </label>
								<label>
								    <input type="radio" name="item[mark_type]" id="words" {$item['mark_type']==0?checked:''} value="0" >文字
								</label>
							</div>
						</div>
						<div class="form-group">
							<label class="label_name">是否添加水印</label>
							<div class="label_checked radio">
								<label>
									<input type="radio" name="item[mark_isopen]" id="open" {$item['mark_isopen']==1?checked:''} value="1" >是
								</label>
								<label>
									<input type="radio" name="item[mark_isopen]" id="close" {$item['mark_isopen']==0?checked:''} value="0" >否
								</label>
							</div>
						</div>
						<div class="form-group image" style="width: 100%;;{$item['mark_type']==1?'display:inline-block':'display:none'}" >
							<label class="label_name">水印图片上传</label>
							<div class="label_img ">
								{:W('Upload/image',array(isset($item['mark_img'])?$item['mark_img']:''))}
							</div>
						</div>

						<div class=" form-group image" style="width: 100%;;{$item['mark_type']==1?'display:inline-block':'display:none'}">
							<label class="label_name">水印图片尺寸</label>
							<div class="label_checked_min ">
								<label>
								    宽(像素)<input type="text" class="label_input_min" name="item[mark_img_w]"  value="{$item['mark_img_w']?$item['mark_img_w']:''}" >
								 </label>
								<label>
								    高(像素)<input type="text" class="label_input_min" name="item[mark_img_h]"  value="{$item['mark_img_h']?$item['mark_img_h']:''}" >
								</label>
							</div>
						</div>

						<div class="form-group words" style="{$item['mark_type']==0?'display:inline-block':'display:none'}">
							<label class="label_name">文字水印内容</label>
							<input class="form-control" type="text" name="item[mark_word]" value="{$item['mark_word']?$item['mark_word']:''}" />
							<span><strong class="bos_red"></strong>尽量限制在5字以内</span>
						</div>

						<div class="form-group">
							<input type="submit" class="btn  btn-primary" value="确认" />
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
	$(function (){
		//判断 如果为ie浏览器则执行下面
		if (!-[1,]) {
			$('input:radio').click(function () {
				this.blur();
				this.focus();
			});
		}
		$('#image').change(function(){
			$('.image').css({display:"inline-block"});
			$('.words').css({display:"none"});
		});
		$('#words').change(function(){
			$('.words').css({display:"inline-block"});
			$('.image').css({display:"none"});
		});
	});
</script>
